#include <stdio.h>
#include <math.h>

int main()
{
	float a, b, c, determinant, r1, r2, real, imag;
	printf ("enter coefficients a, b and c:\n");
	scanf("%f %f %f",&a, &b, &c);
	determinant = b*b - 4*a*c;
	if(determinant>0)
	{
		r1 = (-b + sqrt(determinant)) / (a*2);
		r2 = (-b - sqrt(determinant)) / (a*2);
		printf ("roots are: %.2f and %.2f \n", r1, r2);
	}
	else if(determinant == 0)
	{
		r1 = r2 = -b/(2*a);
		printf ("roots are: %.2f and %.2f \n", r1, r2);
	}
	else
	{
		real = -b/(2*a);
		imag = sqrt(-determinant) / (2*a);
		printf ("roots are: %.2f+%.2fi and %.2f-%.2fi \n", real, imag, real,imag);
		
	}
	return 0;
}
